#PBAR_Zspec_GenerateCalibrationFile2ndSet.py
#
#  Creates the gain calibration file.
#
#  5/1/2013, John Kwong
#  9/24/2013, JK, uses new version of the gain calibration calculator
#  4/3/2014, JK for 2nd set of zspec data

import PBAR_Zspec
reload(PBAR_Zspec)
import numpy as np
# Location of data
basepath = r'C:\Users\jkwong\Documents\Work\PBAR\data4\Mar-files'

countRange = np.array([0.5, 2.0])  # look at count rate at 60Hz in this range.
binBounds = [20, 130] # look at bins between this range # was [20, 120] for 1st set
rateLook = 1.0
binBaseline = 100.0
#CreateGainCorrectionFile2ndSet(basepath, filename, rateRange, binBounds, rateLook, binBaseline):
PBAR_Zspec.CreateGainCorrectionFile2ndSet(basepath, 'GainCorrectionVer2.csv', countRange, binBounds, rateLook, binBaseline)
print('Done.')